package com.foreknow.oop;

/**
 * 构造器
 *
 * @author shkstart
 * @create 2021-07-23 11:25
 */
public class ConstructorDemo {
    private String name;
    private int age;
    private Student[] students;
    public ConstructorDemo(String name, int age) {
        this.name = name;
        this.age = age;
        students =new Student[10];
//        System.out.println("这是一个构造器");
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public static void main(String[] args) {
        ConstructorDemo constructorDemo = new ConstructorDemo("gender", 23);
        System.out.println(constructorDemo.getName() + "***********" + constructorDemo.getAge());
    }


}
